package com.jx.mlxg.controller;


import com.jx.mlxg.entity.Product;
import com.jx.mlxg.service.ProductService;
import com.jx.mlxg.utils.ResponseResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;


@RestController
@RequestMapping("/order")
public class ProductController {

    @Resource
    private ProductService productService;

    @RequestMapping("/getOrderParams")
    public ResponseResult<HashMap<String, Object>> getProduct(){
        List<Product> products = productService.list();
        HashMap<String, Object> hashMap = new HashMap<>();
        ArrayList<Object> list = new ArrayList<>();
        list.add("1");
        list.add("2");
        hashMap.put("products",products);
        hashMap.put("countRange",list);
        return ResponseResult.success(hashMap);
    }
}
